<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>


        const obj = {
            name : 'yy' , 
            age : 17 , 
            sex : '男'
        }


        // const name = obj.name ;
        // const age = obj.age ;
        // const sex = 女 
        // sex =  obj.sex ;
        const {
            name , 
            age ,
            // 给sex一个默认值
            sex = '女',
        } = obj ;

        console.log(sex);



    </script>
    
</body>
</html>